package com.sinaapp.gavinzhang.GSpider.http;

import com.sinaapp.gavinzhang.GSpider.config.Constants;

import java.io.OutputStream;
import java.io.PrintStream;

/**
 * Created by Gavin on 2015-11-20.
 */
public class ResponseOut {

    private OutputStream outputStream;


    public void print200(String title,String content)
    {
        String str = "<html><head><title>"+title+"</title></head><body>"+content+"</html>";
        String header = Constants.HEADER+"Content-Length:"+(str.length())+Constants.DOUBLE_LINE_FEED+str;
        PrintStream out = new PrintStream(outputStream);
        out.print(header);
    }

    public void setOutputStream(OutputStream outputStream) {
        this.outputStream = outputStream;
    }
}
